package scuts;
import haxe.PosInfos;
import utest.Assert;



/**
 * ...
 * @author $(DefaultUser)
 */

class ScutsAssert 
{

  public static function assertIteratorEquals<T>(expected:Iterator<T>, actual:Iterator<T>, ?posInfos:PosInfos):Void
  {
    var it1 = expected;
    var it2 = actual;
    while (it1.hasNext() && it2.hasNext()) {
      var v1 = it1.next();
      var v2 = it2.next();
      Assert.same(v1, v2, true, posInfos);
    }
    if (it1.hasNext() != it2.hasNext()) {
      Assert.fail("iterators have a different number of elements");
    }
  }
  
}